package model

//商品表

type Goods struct {
	BaseModel
	Name string  					`form:"name" json:"name" binding:"required" gorm:"not null;comment:商品名"`
	GoodsSc string  				`form:"goods_sc" json:"goods_sc"  gorm:"comment:商品货号"`
	CategoryId uint  				`form:"category_id" json:"category_id" gorm:"default:0;comment:分类表category主键id"`
	GoodsModelId uint  				`form:"goods_model_id" json:"goods_model_id" gorm:"default:0;comment:商品模型表goods_model主键id"`
	BrandId uint  					`form:"brand_id" json:"brand_id" gorm:"default:0;comment:品牌表brand的主键id"`
	BossId uint  					`form:"boss_id" json:"boss_id" gorm:"not null;default:0;comment:商家表boss主键id,0表示自营"`
	BossName string  				`form:"boss_name" json:"boss_name" gorm:"size:30;comment:商家表boss姓名,0表示自营"`
	BossAvatar string  				`form:"boss_avatar" json:"boss_avatar" gorm:"comment:商家表boss头像,0表示自营"`
	BossPhone string  				`form:"boss_phone" json:"boss_phone" gorm:"size:10;comment:商家表boss手机号,0表示自营"`
	PromType uint  					`form:"prom_type" json:"prom_type" gorm:"type:tinyint(1) not null;default:0;comment:商品类型 0默认1秒杀/抢购 2团购 3优惠促销"`
	PromId uint  					`form:"prom_id" json:"prom_id" gorm:"not null;default:0;comment:活动id 0默认无活动 1秒杀/抢购 2团购 3优惠促销"`
	Title string  					`form:"title" json:"title" binding:"required" gorm:"not null;comment:商品title"`
	Desc string  					`form:"desc" json:"desc" gorm:"type:text;comment:描述"`
	ImgUrl string  					`form:"img_url" json:"img_url" gorm:"not null;comment:商品封面图"`
	MarkPrice float64  				`form:"mark_price" json:"mark_price" gorm:"type:decimal(10,2) not null;default:0.00;comment:商品表goods市场价"`
	ShopPrice float64  				`form:"shop_price" json:"shop_price" gorm:"type:decimal(10,2) not null;default:0.00;comment:商品表goods商店价"`
	//会员价 不写 到vip相关等级表，根据vip的等级不同，减免的价格不同
	//MemberPrice float64  			`form:"member_price" json:"member_price" gorm:"type:decimal(10,2) not null;default:0.00;comment:商品表goods会员折扣价"`
	CostPrice float64  				`form:"cost_price" json:"cost_price" gorm:"type:decimal(10,2) not null;default:0.00;comment:商品表goods会员折扣价"`
	Sales uint  					`form:"sales" json:"sales" gorm:"not null;default:0;comment:销量"`
	IsHot uint  					`form:"is_hot" json:"is_hot" gorm:"type:tinyint(1) not null;default:0;comment:是否热销 0 否 1 是"`
	IsOn uint  						`form:"is_on" json:"is_on" gorm:"type:tinyint(1) not null;default:1;comment:1 上架 0 下架"`
	IsRecommend uint  				`form:"is_recommend" json:"is_recommend" gorm:"type:tinyint(1) not null;default:0;comment:是否推荐到首页 0 否 1 是"`
	IsFreeFreight uint  			`form:"is_free_freight" json:"is_free_freight" gorm:"type:tinyint(1) not null;default:1;comment:是否免运费  0 否 1 是"`
	FreightId uint  				`form:"freight_id" json:"freight_id" gorm:"default:0;comment:运费表freight主键id/运费模板id"`

	Stock uint  					`form:"stock" json:"stock" gorm:"not null;default:1;comment:商品库存"`
	Content uint  					`form:"content" json:"content" gorm:"type:longtext not null;default:1;comment:商品详情"`
}